1. Field of the Invention
The present invention relates to an image processing device, an imaging device, an image processing method, and a program, and more particularly, to a technique that separates a main object region from a background region in image data.
2. Description of the Related Art
In a case in which imaging is performed while flash light is emitted, a main object with a short object distance and a background with a long object distance are mainly affected by different light sources. That is, an image of the main object which has a short object distance and is likely to be irradiated with flash light is captured while being mainly affected by flash light and an image of the background which has a long object distance and is not likely to be irradiated with flash light is captured while being mainly affected by environmental light.
In a case in which the main object and the background are affected by different light sources, appropriate image processing needs to be performed for an image region including the main object (hereinafter, referred to as a “main object region”) and an image region including the background (hereinafter, referred to as a “background region”).
Specifically, in a case in which white balance processing (hereinafter, referred to as “WB processing”) is performed to appropriately correct the color (color balance) of the main object region, a white balance gain (hereinafter, referred to as a “WB gain”) for cancelling the influence of flash light needs to be applied to the main object region. In contrast, in a case in which WB processing is performed to appropriately correct the color (color balance) of the background region, a WB gain for cancelling the influence of environmental light needs to be applied to the background region. Therefore, in some cases, when a common WB gain is applied to the entire region of an image, it is difficult to appropriately correct both the color (color balance) of the main object region and the color (color balance) of the background region.
A method has been known which performs multi-area white balance processing (hereinafter, referred to as “multi-area WB processing”) to apply different white balance gains (hereinafter, referred to as “WB gains”) to a main object region and a background region. According to the multi-area WB processing, even in an image in which an object is irradiated with light components from a plurality of light sources at a different ratio in each region, it is possible to appropriately correct the color (color balance) of each region.
However, in a case in which multi-area WB processing is performed, it is necessary to accurately determine a main object region and a background region. When the main object region and the background region are inaccurately determined, an unnatural image is obtained. Therefore, in the related art, various methods for determining a main object region and a background region have been considered.
For example, as a technique for separating a main object region from a background region, JP2000-308068A discloses a method which acquires an image obtained by capturing a scene while emitting flash light and an image obtained by capturing the same scene without emitting flash light and separates a main object region from a background region on the basis of the difference between two acquired images.
JP2009-200924A discloses a method which acquires an image obtained by capturing a scene while increasing the emission intensity of flash light and an image obtained by capturing the same scene while decreasing the emission intensity of flash light and separates a main object region from a background region on the basis of the difference between two acquired images.